package library.livedata.bus;

import android.arch.lifecycle.LifecycleOwner;
import android.arch.lifecycle.Observer;
import android.support.annotation.NonNull;

import java.util.concurrent.TimeUnit;

/**
 * @author Created by ASUS on 2019/3/4.
 * @version 1.0
 * @description Observable interface
 */
public interface Observable<T> {
    void setValue(T value);

    void postValue(T value);

    void postValueDelay(T value, long delay);

    void postValueDelay(T value, long delay, TimeUnit unit);

    void observe(@NonNull LifecycleOwner owner, @NonNull Observer<T> observer);

    void observeSticky(@NonNull LifecycleOwner owner, @NonNull Observer<T> observer);

    void observeForever(@NonNull Observer<T> observer);

    void observeStickyForever(@NonNull Observer<T> observer);

    void removeObserver(@NonNull Observer<T> observer);
}
